import { defineStore } from "pinia"

import { getDetail } from "@/services"
import { toRaw } from "vue"
export const useDetailStore = defineStore("detail", {
  state() {
    return {
      detailData: {},
      housePics: {},
      mainPart: {},
      houseId: 0,
    }
  },
  actions: {
    async fetchDetailData() {
      const res = await getDetail(this.houseId)
      this.detailData = res.data
      this.housePics = res.data.mainPart.topModule.housePicture.housePics
      this.mainPart = res.data.mainPart
    },
  },
})
